package com.jimmy.reggie.controller;

import com.jimmy.reggie.entity.Orders;
import com.jimmy.reggie.common.R;
import com.jimmy.reggie.service.OrdersService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/order")
@Slf4j
public class OrderController {

    @Autowired
    private OrdersService ordersService;

    @PostMapping("/submit")
    public R<String> orderSumbit(@RequestBody Orders orders){
               log.info(orders.toString());
               ordersService.submit(orders);
               return R.success("提交成功");
    }


}
